<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateWorkOrderUser extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (Schema::hasTable('work_order_user')) {
            return;
        }
        Schema::create('work_order_user', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('work_order_id');
            $table->unsignedInteger('user_id')->comment('人员ID');
            $table->unsignedTinyInteger('is_master')->comment('是否负责人');
            $table->integer('create_time')->nullable();
            $table->integer('update_time')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {

    }
}
